﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Activities;

using CloudSoft.Workflows;

namespace ERPStore.Exporter.Workflows.Activities
{
	public sealed class SaveDocument : CodeActivity
	{
		public InArgument<Providers.IExport> ExportArgument { get; set; }

		protected override void Execute(CodeActivityContext context)
		{
			var export = context.GetValue(ExportArgument);
			export.SaveDocument();
			context.ReportProgress(string.Format("file {0} saved with {1} products", export.Settings.FileName, export.Settings.ProductCount));
			export.SaveSettings();
		}
	}
}
